package com.fanrenqiji.entity;

import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.Where;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.List;

/**
 * Created by yanwt on 2017/3/13.
 */
@Getter
@Setter
@Entity
@Table(name = "tb_feedback")
@org.hibernate.annotations.Table(appliesTo = "tb_feedback", comment = "问题反馈")
@org.hibernate.annotations.DynamicInsert
@org.hibernate.annotations.DynamicUpdate
@org.hibernate.annotations.Cache(region="feedback", usage = CacheConcurrencyStrategy.READ_WRITE)
public class FeedbackEntity extends DataEntity {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @Column(columnDefinition="text not null comment '反馈内容'")
    private String content;

    @ManyToOne
    @JoinColumn(name = "parent_id", columnDefinition = ("bigint(20) default null comment '家长ID'"))//,foreignKey = @ForeignKey(value=ConstraintMode.NO_CONSTRAINT))
    @Where(clause = "del_flag=" + DEL_FLAG_NORMAL)
    private ParentEntity parent;
}
